import request from '@/utils/request'

// 查询码方案列表
export function listPlatCodeManagement(query) {
  return request({
    url: '/bus/platCodeManagement/list',
    method: 'get',
    params: query
  })
}

// 查询码方案详细
export function getPlatCodeManagement(id) {
  return request({
    url: '/bus/platCodeManagement/' + id,
    method: 'get'
  })
}

// 新增码方案
export function addPlatCodeManagement(data) {
  return request({
    url: '/bus/platCodeManagement',
    method: 'post',
    data: data
  })
}

// 修改码方案
export function updatePlatCodeManagement(data) {
  return request({
    url: '/bus/platCodeManagement',
    method: 'put',
    data: data
  })
}

// 删除码方案
export function delPlatCodeManagement(id) {
  return request({
    url: '/bus/platCodeManagement/' + id,
    method: 'delete'
  })
}

// 查询码方案秘钥配置详细
export function getCodeManagementConfig(id) {
  return request({
    url: '/bus/platCodeManagement/getSecret/' + id,
    method: 'get'
  })
}

// 新增码方案秘钥配置
export function addCodeManagementConfig(data) {
  return request({
    url: '/bus/codeManagementConfig',
    method: 'post',
    data: data
  })
}

// 修改码方案秘钥配置
export function updateCodeManagementConfig(data) {
  return request({
    url: '/bus/codeManagementConfig',
    method: 'put',
    data: data
  })
}

// 生成发卡机构公私钥
export function generateCardSecret() {
  return request({
    url: '/bus/codeManagementConfig/cardSecretGenerate',
    method: 'post'
  })
}

// 生成支付账号公私钥
export function generateUserPaySecret() {
  return request({
    url: '/bus/codeManagementConfig/userPaySecretGenerate',
    method: 'post'
  })
}
